package com.ruoyi.school.enums;

import lombok.Getter;

@Getter
public enum UserSexEnum {
    MAN("0", "男"),
    WOMAN("1", "女"),
    OTHER("2", "未知");

    private final String code;
    private final String info;

    UserSexEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public static UserSexEnum getEnum(String code) {
        for (UserSexEnum sexEnum : UserSexEnum.values()) {
            if (sexEnum.getCode().equals(code)) {
                return sexEnum;
            }
        }
        return null;
    }
}
